using System.Collections.Generic;

using com.tc.zigbee.zcl;

using com.tc.util;
namespace com.tc.zigbee.zcl.command
{
    public class ConfigReportResponse : AbstractZclCommand
    {
    public List<AttributeStatusRecord> getAttributes()
        {
            return attributes;
        }
        List<AttributeStatusRecord> attributes = new List<AttributeStatusRecord>();
        public ConfigReportResponse(byte[] data)
        {

            int l = data.Length / 4;
            for (int i = 0; i < l; i++)
            {
                AttributeStatusRecord r = new AttributeStatusRecord();
                r.status = data[4 * i];
                r.direction = data[4 * i + 1];
                byte[] buf = new byte[2];
                buf[0] = data[4 * i + 2];
                buf[1] = data[4 * i + 3];
                r.attribute = DataUtil.shortValue(buf);
                attributes.Add(r);
            }

        }
    }
    public class AttributeStatusRecord
    {
        public byte status;
        public byte direction;
        public short attribute;
    }
}